<%@ page language="java" pageEncoding="UTF-8"%>
<%@page import="com.shsh.safemanage.util.Constants"%>
<%@page import="java.util.Calendar"%>

<%
Calendar now = Calendar.getInstance();
String yearStr = request.getParameter(Constants.REQUEST_PARAMETER_YEAR);

int year = now.get(Calendar.YEAR);
int currYear = now.get(Calendar.YEAR);
try {
	year = Integer.parseInt(yearStr);
} catch (Exception e) {
}

int month = now.get(Calendar.MONTH) + 1;
if (year < currYear) {
	month = 12;
} else if (year > currYear) {
	year = currYear;
}
%>
<table width="100%">
	<tr>
		<td width="5" height="30">&nbsp;</td>
		<td style="border: 1px #E3E3E3 solid" class="a_text1" width="10%">
		<%
		if (year >= currYear) {
		%>
		&nbsp;
		<%
		} else {
		%>
		【<a href="javascript:" onclick="loadPageSection('month_href_section.jsp', 'monthSpan', {year:<%=(year+1)%>}, false)"><%=(year+1)%>年度</a>】
		<%
		}
		%>
		</td>
		<td style="border: 1px #E3E3E3 solid; border-left: 0px;"
			class="a_text1">
			<%
			for (; month > 0; month--) {
				now.set(Calendar.MONTH, month-1);
				int date = now.getActualMaximum(Calendar.DAY_OF_MONTH);
			%>
			<span>【<a href="javascript:" onclick="browseAllProblemByMonth('<%=year%>-<%=month%>-01','<%=year%>-<%=month%>-<%=date%>')"><%=month%>月份</a>】</span>
			<%
			}
			%>
		</td>
		<td width="8%" style="border: 1px #E3E3E3 solid; border-left: 0px;" class="a_text1">
		【<a href="javascript:" onclick="loadPageSection('month_href_section.jsp', 'monthSpan', {year:<%=(year-1)%>}, false)"><%=(year-1)%>年度</a>】</td>
		<td width="5">&nbsp;</td>
	</tr>
</table>